package cn.jetpiece.cloud.joss.app.config;

import cn.jetpiece.cloud.joss.app.core.exception.SystemErrorAttributes;
import cn.jetpiece.cloud.joss.app.modular.accessor.context.AccessorContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * 全局配置
 *
 * @author XuJZ
 * @since 2020-01-10 17:37
 */
@Configuration
public class ContextConfig {

    @Bean
    public AccessorContext accessorContext(RedisTemplate<String, Object> redisTemplate) {
        return new AccessorContext(redisTemplate);
    }

    /**
     * 错误信息提示重写
     */
    @Bean
    public SystemErrorAttributes systemErrorAttributes() {
        return new SystemErrorAttributes();
    }
}
